<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    <!--    用户输入名字，存储到变量中-->
    var myname = prompt("请输入你的名字")
    alert(myname)
</script>
</body>
</html>